#!/user/bin/env python3
# -*- coding: utf-8 -*-
# author:YaFans

'''
用户登录验证
    - 用户依次输入用户名和密码，然后提交验证
    - 用户不存在、密码错误，都显示用户名或密码错误提示
    - 错误3次，则退出程序
    - 验证成功则显示登录信息
'''

for _ in range(3):
    username = input('Pls input your username:')
    password = input('Pls input your password:')

    if username ==  'chenjiaji' and password == '123456':
        print('login sucessful')
        break
    else:
        print('username or password is incorrect')
else:
    print('Too many failures')


# 做得不错
